<?php

namespace app\model;

use support\Db;
use support\Model;

class Cate extends Model
{
    protected $table = 'cates';
    protected $connection = 'mysql_admin';
    protected $primaryKey = 'id';
    public $timestamps = false;

    public static function getInfo($cate_id){
        if(isset($GLOBALS['cateData'][$cate_id])){
            return $GLOBALS['cateData'][$cate_id];
        }
        $cate = Db::connection('mysql_admin')->table('cates')->where('id',$cate_id)->first();
        if($cate) $cate = object2array($cate);
        $GLOBALS['cateData'][$cate_id] = $cate;
        return $cate;
    }




}
